﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Temp_20190707_AForm
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
        private void button1_Click(object sender, EventArgs e)
        {
            button2_Click(sender, e);
            //dockPanel1.ShowDLPanel(null);
        }
        private void button2_Click(object sender, EventArgs e)
        {
            //dockPanel1.HideDLPanel();
        }
        private void button3_Click(object sender, EventArgs e)
        {
            Panel panel = new Panel();
            TextBox box = new TextBox();
            box.Parent = panel;
            panel.BackColor = RandomColor();
            dockPanel1.ShowControl(panel);
        }

        public static Color RandomColor()
        {
            return Color.FromArgb(new Random(Guid.NewGuid().GetHashCode()).Next(0, 256), new Random(Guid.NewGuid().GetHashCode()).Next(0, 256), new Random(Guid.NewGuid().GetHashCode()).Next(0, 256));
        }

        private void button4_Click(object sender, EventArgs e)
        {
            this.dockPanel1.ResetLayout();
        }


    }
}
